package com.tengju.data.infrastructure.repository.convert;

import com.tengju.data.domain.model.report.BonusSettleRecord;
import com.tengju.data.infrastructure.persistence.mybatis.dataobject.BonusSettleRecordDO;

/**
 * @author chenhang
 * @Date 2021/4/19
 */
public class BonusSettleRecordConvert {

    public static BonusSettleRecordDO toDO(BonusSettleRecord record) {
        if (record == null) {
            return null;
        }
        BonusSettleRecordDO recordDO = new BonusSettleRecordDO();
        recordDO.setIdCode(record.getIdCode().getValue());
        recordDO.setMonth(record.getMonth().getMonthInt());
        recordDO.setUniqueId(record.getUniqueId());
        recordDO.setSettleMonth(record.getSettleMonth().getMonthInt());
        recordDO.setBonus(record.getBonus());
        return recordDO;
    }
}
